package day06;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/8
 */
public class Demo4 {
    public static void main(String[] args) {
        //3键盘输入5个人名到数组,然后变量输出这个人名
        Scanner sc = new Scanner(System.in);
        String[] arr = new String[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第"+(i+1)+"个姓名：");
            String name = sc.next();
            arr[i] = name;
        }
        System.out.println(Arrays.toString(arr));
    }
}
